package com.mz.ozy.widget.dialog;

import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.mz.ozy.R;

public class ConfirmCollectDialog extends BaseDialog implements View.OnClickListener {

    private EditText mEtDescribeMsg;
    private TextView mTvGoodsPrice;
    private TextView mTvBalance;

    public ConfirmCollectDialog(Activity mContext) {
        super(mContext, R.layout.dialog_order_confirm_collect, Gravity.CENTER, true, true);
        initView();
    }

    private void initView() {
        setOnViewClick(R.id.tv_cancel, this);
        setOnViewClick(R.id.tv_submit, this);
        mEtDescribeMsg = getView(R.id.et_describe_msg);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_cancel:
                if (mListener != null) {
                    mListener.onCancel();
                }
                break;
            case R.id.tv_submit:
                if (mListener != null) {
                    String msg = mEtDescribeMsg.getText().toString().trim();
                    mListener.onSubmit(msg);
                }
                break;
        }
    }

    private onDialogListener mListener;

    public void setOnDialogListener(onDialogListener listener) {
        mListener = listener;
    }

    public interface onDialogListener {
        void onCancel();

        void onSubmit(String id);
    }
}
